package com.knight.study.patterns.tujie.factory;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author knight
 * @Date 2024/9/10 15:42
 */

public class IDCardFactory extends Factory {

    private List owners = new ArrayList();

    public List getOwners() {
        return owners;
    }

    @Override
    protected Product createProduct(String owner) {
        return new IDCard(owner);
    }

    @Override
    protected void registerProduct(Product product) {
        owners.add(((IDCard)product).getOwner());
    }
}
